<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:p="http://primefaces.org/ui" template="/templates/layout.xhtml">

	<ui:define name="ptitle">新增用户</ui:define>
	<ui:define name="pcontent">
		<h:form id="frm1">
			<p:growl id="msgs1" showDetail="true" />
			<p:panel id="userPanel" header="登陆用户信息" style="margin-bottom:5px"
				footer="请输入正确的帐号、密码等必要信息进行注册。">
				<h:panelGrid columns="8" cellspacing="10" style="font-size:18px;">	
					<p:outputLabel for="userno" value="登录帐号:" style="color:red;" />
					<p:inputText id="userno" placeholder="输入登录帐号"
						value="#{sysUserAddMB.user.userno}" onfocus="this.select();"
						required="true" requiredMessage="登录帐号必须输入"
						validatorMessage="帐号验证不过(3-16个字符)">
						<f:validateRegex pattern="^[A-Za-z0-9]{3,16}$" />
					</p:inputText>
					<p:outputLabel for="username" value="昵称:" />
					<p:inputText id="username" placeholder="输入昵称"
						value="#{sysUserAddMB.user.username}">
					</p:inputText>
					<p:outputLabel for="password" value="密码:" style="color:red;" />
					<p:password id="password" placeholder="输入登录密码"
						value="#{sysUserAddMB.user.password}" onfocus="this.select();"
						required="true" requiredMessage="密码必须输入"
						validatorMessage="密码验证不过(3-20个字符)">
						<f:validateRegex
							pattern="^[A-Za-z0-9~`!@#$%^&amp;*()_&lt;&gt;/\\{}:;,.?]{3,20}$" />
					</p:password>	
	
					<p:outputLabel for="email" value="邮箱:" style="color:red;" />
					<p:inputText id="email" placeholder="输入联系邮箱" type="email"
						value="#{sysUserAddMB.user.email}" onfocus="this.select();"
						required="true" requiredMessage="邮箱必须输入"
						validatorMessage="邮箱验证不过">
						<f:validateRegex
							pattern="[a-zA-Z0-9_]*[@]{1}[a-zA-Z0-9_]*[.]{1}[a-zA-Z]{2,3}" />
					</p:inputText>

					<p:outputLabel for="phone" value="手机号:" style="color:red;" />
					<p:inputText id="phone" placeholder="输入联系手机号码" type="tel"
						value="#{sysUserAddMB.user.phone}" onfocus="this.select();"
						required="true" requiredMessage="手机号必须输入"
						validatorMessage="手机号验证不过">
						<f:validateRegex pattern="1[3-8][0-9]\d{8}" />
					</p:inputText>
					
					<p:outputLabel for="address" value="联系地址" />
					<p:inputText id="address" value="#{sysUserAddMB.user.address}" />
					<p:outputLabel for="remark" value="备注" />
					<p:inputText id="remark" value="#{sysUserAddMB.user.remarks}" />
					
				</h:panelGrid>
				<h:panelGrid columns="3">
					<p:commandButton value="取消" icon="ui-icon-power"
						action="#{sysUserAddMB.cancelAction}" update="msgs1">
					</p:commandButton>
					<p:commandButton value="提交" icon="ui-icon-check"
						action="#{sysUserAddMB.addAction}" update="msgs1">
					</p:commandButton>

				</h:panelGrid>

			</p:panel>
		</h:form>			

	</ui:define>
</ui:composition>

